package tech.aistar.service.personinfo.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.entity.authordis.NoteAuthor;
import tech.aistar.entity.authordis.UserTable;
import tech.aistar.entity.notepay.NoteOrder;
import tech.aistar.mapper.PersonInfoMapper;
import tech.aistar.service.personinfo.IPersonInfoService;

import java.util.List;

/**
 * Created by Dell on 2019/10/1.
 */
@Service
@Transactional
public class PersonInfoServiceImpl implements IPersonInfoService {
    @Autowired
    private PersonInfoMapper personInfoMapper;


    @Override
    public UserTable getById(Integer id) {

        UserTable userTable = personInfoMapper.getById(id);

        return userTable;
    }

    @Override
    public NoteAuthor findUserInfoById(Integer user_id) {

        NoteAuthor noteAuthor = personInfoMapper.findUserInfoById(user_id);

        return noteAuthor;
    }

    @Override
    public void saveUserTable(UserTable userTable){

        personInfoMapper.saveUserTable(userTable);

    }

    @Override
    public void saveHeadImg(Integer id,String headImg) {
        personInfoMapper.saveHeadImg(id,headImg);
    }

    @Override
    public List<NoteOrder> findNoteOrder(Integer user_id) {
        List<NoteOrder> noteOrder =personInfoMapper.findNoteOrder(user_id);
        return noteOrder;
    }
}
